-
Notifications
You must be signed in to change notification settings - Fork 121
Fix iPhone UI test failure in trunk from customer details address form #15969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…wn the address toggle by dismissing the keyboard with `\n` in the text field.
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an iPhone UI test failure in the customer details address form where the shipping first name field tap was failing due to the keyboard obscuring the address toggle switch on smaller screens.
- Adds
\nto dismiss the keyboard after entering billing first name - Adds table view swipe gestures to ensure proper visibility of UI elements
- Specifically targets the
test_create_new_orderUI test failure on iPhone simulators
| addressToggleSet(to: "1") | ||
| tableView.swipeUp() |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| // `\n` was added after the first name input in order to dismiss the keyboard so that the address toggle is interactive in shorter screens. | ||
| billingFirstNameField.typeText("\(name)\n") |
Copilot
AI
Aug 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using \n to dismiss the keyboard is a workaround that may not be reliable across different iOS versions or keyboard configurations. Consider using a more explicit keyboard dismissal method such as tapping a done button or using app.keyboards.buttons["Done"].tap() if available.
| // `\n` was added after the first name input in order to dismiss the keyboard so that the address toggle is interactive in shorter screens. | |
| billingFirstNameField.typeText("\(name)\n") | |
| // Tap the done button to dismiss the keyboard after entering the first name. | |
| billingFirstNameField.typeText(name) | |
| doneButton.tap() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Done" can be unreliable as well, as the OS can change the keyboard return button in future iOS versions.
iamgabrielma
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fix! Test pass ✅
Locally, it failed on a separate screen when editing the order shipping amount but this is unrelated to the address picker change.
Yes, I'm seeing this as well, seems to happen in iPad only due to failing to focus on the textfield to write the amount, or similar. Interestingly it seems to pass in CI ¯_(ツ)_/¯
|
Thanks for reporting and testing! The separate local failure for me was on iPhone 16 iOS 18.5 simulator which is the same device type as on CI, but it passed consistently on CI 🤔 |

For WOOMOB-957
Just one review is required.
Description
Fixes iPhone UI test failure
test_create_new_orderin the customer details address form, where the shipping first name field tap was failing. The issue occurred because:I can reproduce the failure locally. The same test case passes on iPad consistently in trunk. The UI test is not able to interact with elements covered by the keyboard.
Fix
After trying a few different ways to wait for the element and swipe up the view before toggling the switch, what worked is to add a
\nto the billing address first name input so that the keyboard is dismissed. This allows the switch to be tappable.Steps to reproduce
test_create_new_orderon iPhone 16 iOS 18.5 simulator following the README -> the test should not fail when trying to tap the shipping first name field after enabling the address toggle. Locally, it failed on a separate screen when editing the order shipping amount but this is unrelated to the address picker change.Testing information
UI tests passed on CI for both iPhone and iPad. The first run of the iPhone UI tests hung after the last test completed, I canceled and retried and it passed.
RELEASE-NOTES.txtif necessary.